<%@page import="java.util.ArrayList"%>
<%@page import="java.lang.reflect.Array"%>
<%@page import="com.itwill.ecom.ordersDetail.OrdersDetailBeans"%>
<%@page import="java.util.List"%>
<%@page import="com.itwill.ecom.ordersDetail.OrdersDetailService"%>
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@page import="org.springframework.web.context.WebApplicationContext"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	WebApplicationContext webContext = WebApplicationContextUtils.getWebApplicationContext(application);
	OrdersDetailService detailService = (OrdersDetailService)webContext.getBean("ordersDetailService");
	
	List<OrdersDetailBeans> detailList = new ArrayList<OrdersDetailBeans>();
	detailList = detailService.getAll();
%>
[
<%
	for(int i = 0 ; i < detailList.size() ; i++){
		OrdersDetailBeans beans = detailList.get(i);
%>
{
	"odetail_no" : "<%= beans.getOdetail_no() %>",
	"odetail_ordersno" : "<%= beans.getOdetail_ordersno() %>",
	"odetail_product" : "<%= beans.getOdetail_product() %>",
	"odetail_count" : "<%= beans.getOdetail_count() %>"	
}
<%
if((i + 1) != detailList.size()) // 이후에 데이터가 아직 남아 있다면
	out.print(","); // ',' 추가
}	
%>
]



